<body>
    <form id="my-form">
        <div id="tools" class="datagrid-toolbar">
            <input type="hidden" name="type" id="type" value="64">
            <a id="closeBtn" name="backOk" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-close"
                plain="true"><span class="l-btn-left"><span
                        class="l-btn-text icon-close l-btn-icon-left">关闭</span></span></a>
        </div>
        <p id="errorMsg" style="color:red;margin-top:5px;"></p>
        <table class="formTable">
            <tbody>
                <tr>
                    <td class="tdc1" style="width:150px;">
                        部门/项目经理：
                    </td>
                    <td colspan="3">
                        <input type="text" name="applyUserName" id="applyUserName" data-options="required:true"
                            class="easyui-validatebox validatebox-text" readonly="">
                        <input type="hidden" name="applyUserId" id="applyUserId" value="982">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        录入意见：
                    </td>
                    <td colspan="3">
                        <textarea name="lrOption" id="lrOption" style="width:732px;height:100px"
                            data-options="required:true" class="easyui-validatebox validatebox-text"
                            readonly="">梁策主要负责早期项目线索挖掘、尽调访谈、立项推荐及投后赋能等工作，任职期间勤勉尽责，累计走访数百家项目，高效完成芯车无限、清治智能等优质项目投资，并高质量履行投后职责；同时团队协作突出，积极配合完成孵化服务、募资支持等多项重点工作，整体表现优异。建议予以续约</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        副总经理：
                    </td>
                    <td colspan="3">
                        <input type="text" name="deptmanagername" id="deptmanagername"
                            class="easyui-validatebox validatebox-text" readonly="">
                        <input type="hidden" name="deptmanagerid" id="deptmanagerid" value="566">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        总经理：
                    </td>
                    <td colspan="3">
                        <input type="text" name="managername" id="managername"
                            class="easyui-validatebox validatebox-text" readonly="">
                        <input type="hidden" name="managerid" id="managerid" value="561">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        董事长：
                    </td>
                    <td colspan="3">
                        <input type="text" name="presidentname" id="presidentname"
                            class="easyui-validatebox validatebox-text" readonly="">
                        <input type="hidden" name="presidentid" id="presidentid" value="560">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        姓 名：
                    </td>
                    <td style="width:38%;">
                        <input type="text" name="name" id="name" data-options="required:true" readonly=""
                            class="easyui-validatebox validatebox-text">
                    </td>
                    <td class="tdc1" style="width:150px;">
                        部 门：
                    </td>
                    <td>
                        <input type="text" name="deptname" id="deptname" data-options="required:true" readonly=""
                            class="easyui-validatebox validatebox-text">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        到公司时间：
                    </td>
                    <td>
                        <input type="text" name="inductionDate" id="inductionDate" readonly="readonly"
                            class="easyui-validatebox validatebox-text">
                    </td>
                    <td class="tdc1">
                        续签年数：
                    </td>
                    <td>
                        <input type="text" id="amount" class="easyui-numberbox numberbox-f validatebox-text"
                            numberboxname="amount"><input type="hidden" name="amount" value="3">
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        续签时间：
                    </td>
                    <td colspan="3">
                        自<input type="text" name="startTime" id="startTime" readonly="readonly"
                            class="easyui-validatebox validatebox-text" style="width:180px;">起至
                        <input type="text" name="endTime" id="endTime" readonly="readonly"
                            class="easyui-validatebox validatebox-text" style="width:180px;">
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
    <div style="margin-left:10px;">
        <div id="showFiles">
            <div style="margin-top:8px;margin-bottom:8px;">个人续约述职小结-梁策-202510.docx<a style="margin-left:10px"
                    href="javascript:" onclick="downfile(781751)">下载</a></div>
        </div>
    </div>
    <br>
    <div id="tools" class="datagrid-toolbar">
        过往劳动合同签订情况
    </div>
    <div id="search" class="datagrid-toolbar" style="display:none;">
        <input type="hidden" name="bid" id="bid" value="1112">
    </div>
    <div class="panel datagrid" style="width: auto;">
        <div class="datagrid-wrap panel-body panel-body-noheader" title="" style="width: 724px; height: auto;">
            <div class="datagrid-view" style="width: 724px; height: 100px;">
                <style type="text/css">
                    div.datagrid-cell-c1-amount {
                        width: undefinedpx;
                    }

                    div.datagrid-cell-c1-startTime {
                        width: 192px;
                    }

                    div.datagrid-cell-c1-endTime {
                        width: 192px;
                    }
                </style>
                <div class="datagrid-view1" style="width: 41px;">
                    <div class="datagrid-header" style="width: 41px; height: 24px;">
                        <div class="datagrid-header-inner" style="display: block;">
                            <table class="datagrid-htable" border="0" cellspacing="0" cellpadding="0"
                                style="height: 25px;">
                                <tbody>
                                    <tr class="datagrid-header-row">
                                        <td rowspan="0">
                                            <div class="datagrid-header-rownumber"></div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="datagrid-body" style="width: 41px; height: 75px;">
                        <div class="datagrid-body-inner">
                            <table class="datagrid-btable" cellspacing="0" cellpadding="0" border="0"
                                style="table-layout: auto;">
                                <tbody>
                                    <tr id="datagrid-row-r1-1-0" datagrid-row-index="0" class="datagrid-row"
                                        style="height: 25px;">
                                        <td class="datagrid-td-rownumber">
                                            <div class="datagrid-cell-rownumber">1</div>
                                        </td>
                                    </tr>
                                    <tr id="datagrid-row-r1-1-1" datagrid-row-index="1" class="datagrid-row"
                                        style="height: 25px;">
                                        <td class="datagrid-td-rownumber">
                                            <div class="datagrid-cell-rownumber">2</div>
                                        </td>
                                    </tr>
                                    <tr id="datagrid-row-r1-1-2" datagrid-row-index="2" class="datagrid-row"
                                        style="height: 25px;">
                                        <td class="datagrid-td-rownumber">
                                            <div class="datagrid-cell-rownumber">3</div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="datagrid-footer" style="width: 41px;">
                        <div class="datagrid-footer-inner" style="display: none;"></div>
                    </div>
                </div>
                <div class="datagrid-view2" style="width: 683px;">
                    <div class="datagrid-header" style="width: 683px; height: 24px;">
                        <div class="datagrid-header-inner" style="display: block;">
                            <table class="datagrid-htable" border="0" cellspacing="0" cellpadding="0"
                                style="height: 25px;">
                                <tbody>
                                    <tr class="datagrid-header-row">
                                        <td field="id">
                                            <div class="datagrid-header-check"><input type="checkbox"></div>
                                        </td>
                                        <td field="amount">
                                            <div class="datagrid-cell" style="width: 56px;"><span>签订年数</span><span
                                                    class="datagrid-sort-icon">&nbsp;</span></div>
                                        </td>
                                        <td field="startTime">
                                            <div class="datagrid-cell" style="width: 277px;"><span>开始日期</span><span
                                                    class="datagrid-sort-icon">&nbsp;</span></div>
                                        </td>
                                        <td field="endTime">
                                            <div class="datagrid-cell" style="width: 278px;"><span> 结束日期</span><span
                                                    class="datagrid-sort-icon">&nbsp;</span></div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="datagrid-body" style="width: 683px; height: 75px;">
                        <table class="datagrid-btable" cellspacing="0" cellpadding="0" border="0"
                            style="table-layout: auto;">
                            <tbody>
                                <tr id="datagrid-row-r1-2-0" datagrid-row-index="0" class="datagrid-row"
                                    style="height: 25px;">
                                    <td field="id">
                                        <div style="" class="datagrid-cell-check "><input type="checkbox" name="id"
                                                value="1299"></div>
                                    </td>
                                    <td field="amount">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-amount">2</div>
                                    </td>
                                    <td field="startTime">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-startTime">
                                            2023-11-01</div>
                                    </td>
                                    <td field="endTime">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-endTime">
                                            2025-10-31</div>
                                    </td>
                                </tr>
                                <tr id="datagrid-row-r1-2-1" datagrid-row-index="1" class="datagrid-row"
                                    style="height: 25px;">
                                    <td field="id">
                                        <div style="" class="datagrid-cell-check "><input type="checkbox" name="id"
                                                value="1298"></div>
                                    </td>
                                    <td field="amount">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-amount">1</div>
                                    </td>
                                    <td field="startTime">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-startTime">
                                            2021-06-15</div>
                                    </td>
                                    <td field="endTime">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-endTime">
                                            2022-06-14</div>
                                    </td>
                                </tr>
                                <tr id="datagrid-row-r1-2-2" datagrid-row-index="2" class="datagrid-row"
                                    style="height: 25px;">
                                    <td field="id">
                                        <div style="" class="datagrid-cell-check "><input type="checkbox" name="id"
                                                value="1280"></div>
                                    </td>
                                    <td field="amount">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-amount">3</div>
                                    </td>
                                    <td field="startTime">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-startTime">
                                            2022-06-15</div>
                                    </td>
                                    <td field="endTime">
                                        <div style="height:auto;" class="datagrid-cell datagrid-cell-c1-endTime">
                                            2025-06-14</div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="datagrid-footer" style="width: 683px;">
                        <div class="datagrid-footer-inner" style="display: none;"></div>
                    </div>
                </div>
                <table id="list_data" style="display: none;"></table>
            </div>
            <div class="datagrid-pager pagination">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tbody>
                        <tr>
                            <td><select class="pagination-page-list">
                                    <option>10</option>
                                    <option>20</option>
                                    <option>30</option>
                                    <option>40</option>
                                    <option>50</option>
                                </select></td>
                            <td>
                                <div class="pagination-btn-separator"></div>
                            </td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain l-btn-disabled" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-first">&nbsp;</span></span></span></a>
                            </td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain l-btn-disabled" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-prev">&nbsp;</span></span></span></a></td>
                            <td>
                                <div class="pagination-btn-separator"></div>
                            </td>
                            <td><span style="padding-left:6px;">第</span></td>
                            <td><input class="pagination-num" type="text" value="1" size="2"></td>
                            <td><span style="padding-right:6px;">共1页</span></td>
                            <td>
                                <div class="pagination-btn-separator"></div>
                            </td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain l-btn-disabled" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-next">&nbsp;</span></span></span></a></td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain l-btn-disabled" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-last">&nbsp;</span></span></span></a></td>
                            <td>
                                <div class="pagination-btn-separator"></div>
                            </td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-load">&nbsp;</span></span></span></a></td>
                        </tr>
                    </tbody>
                </table>
                <div class="pagination-info">显示1到3,共3记录</div>
                <div style="clear:both;"></div>
            </div>
        </div>
    </div>
    <div style="margin-left:10px;">
        <div id="showRecords">
            <div style="margin-top:8px;margin-bottom:8px;">审核人：韩威<span style="margin-left:15px;">尚未审核</span></div>
            <div style="margin-top:8px;margin-bottom:8px;">审核人：沈全洪<span style="margin-left:15px;">尚未审核</span></div>
            <div style="margin-top:8px;margin-bottom:8px;">审核人：张金生<span style="margin-left:15px;">尚未审核</span></div>
            <div style="margin-top:8px;margin-bottom:8px;">复核人：王一翀<span style="margin-left:15px;">尚未复核</span></div>
        </div>
    </div>


    <script>

        function checkFormMe(form) {

            return $('#my-form').form('validate');
        }
        var type = $.getUrlParam("type");
        $("#type").val(type);

        var p_id = $.getUrlParam("id");
        var objectId = new Date().getTime();
        var process_id = $.getUrlParam("processid");
        if (process_id != null) {
            $.ajax({
                type: "GET",
                url: contextPath + "manager/approvalprocess/getBeanIdByProcessId/" + process_id + "/" + type,
                data: null,
                dataType: "json",
                success: function (data) {
                    if (data && data.handleMsg.status == 1) {
                        p_id = data.id;
                        if (p_id != null) {
                            objectId = p_id;
                            $("#bid").val(p_id);
                        }
                        $("#objectId").val(objectId);
                        loadBassModel(p_id);
                        loadDetails(p_id);
                        loadRecord(process_id)
                    }
                },
                error: function (response) {
                    $.messager.alert("提示", "出错了，请联系管理员!", 'error', function (rt) {
                        $.messager.alert("提示", response.responseText, 'error');
                    });
                }

            });
        } else {
            if (p_id != null) {
                objectId = p_id;
                $("#bid").val(p_id);
            }
            $("#objectId").val(objectId);
            loadBassModel(p_id);
            loadDetails(p_id);
            loadRecord(process_id)
        }

        function loadBassModel(p_id) {
            var BaseModel = Backbone.Model.extend({ urlRoot: contextPath + 'manager/personRenew' });
            var baseModel;

            if (p_id == null) {
                baseModel = new BaseModel();
            } else {
                baseModel = new BaseModel({ id: p_id, i: new Date().getTime() });
            }
            var baseView = new BaseView({ el: $("#my-form"), model: baseModel });
            if (p_id != null) {
                baseView.doLoad(loadMe);
            }
        }

        function loadMe(model, response, options) {
            if (model.get("approvalProcess")) {
                $("#applyUserName").val(model.get("approvalProcess").applyUserName);
                $("#applyUserId").val(model.get("approvalProcess").applyUserId);
                $("#type").val(model.get("approvalProcess").type);
                if (model.get("inductionDate") != null) {
                    $("#inductionDate").val(model.get("inductionDate").substr(0, 10));
                }
                if (model.get("startTime") != null) {
                    $("#startTime").val(model.get("startTime").substr(0, 10));
                }
                if (model.get("endTime") != null) {
                    $("#endTime").val(model.get("endTime").substr(0, 10));
                }

                $("#lrOption").text(model.get("lrOption"));
            }
            getAffixs();
        }



        var max_uplaod = new Max_SwfUpload();

        function getAffixs() {
            $.ajax({
                type: "POST",
                url: contextPath + "affixs",
                data: { "objectType": 641, objectId: objectId },
                dataType: "json",
                success: function (data) {
                    if (data && data.length > 0) {
                        showAffixs(data);
                    }
                },
                error: function (response) {
                    $.messager.alert("提示", "出错了，请联系管理员!", 'error', function (rt) {
                        $.messager.alert("提示", response.responseText, 'error');
                    });
                }

            });
        }

        getAffixs();

        function showAffixs(data) {
            var fileHtml = "";
            for (var i = 0; i < data.length; i++) {
                fileHtml += "<div style=\"margin-top:8px;margin-bottom:8px;\">" + data[i].name;
                fileHtml += "<a style=\"margin-left:10px\" href=\"javascript:\" onclick=\"downfile(" + data[i].id + ")\">下载</a></div>";
            }
            $("#showFiles").html(fileHtml);
        }

        function downfile(affixId) {
            window.location.href = contextPath + 'affix/' + affixId + '/download';
        }





        function loadDetails(p_id) {
            $('#list_data').datagrid({
                url: contextPath + "manager/personRenewDetails?i=" + new Date().getTime(),
                fitColumns: true,
                singleSelect: false,
                rownumbers: true,
                pagination: true,
                sortName: 'id',
                sortOrder: 'desc',
                method: 'POST',
                onRowContextMenu: onRowContextMenu,//右键菜单
                queryParams: { "bid": p_id },
                columns: [[
                    { field: 'id', checkbox: true, width: 100 },
                    { field: 'amount', title: '签订年数' },
                    { field: 'startTime', title: '开始日期', width: 200, formatter: dateFormat },
                    { field: 'endTime', title: ' 结束日期', width: 200, formatter: dateFormat }
                ]]
            });
        }

        function dateFormat(value) {
            if (value != null) {
                return value.substr(0, 10);
            }
        }

        //添加的方法
        function add() {
            parent.addTabs("新增劳动合同签订情况", contextPath + "system/qdzxapproval/approval/personrenew_detail_add.html?personRenewId=" + p_id + "&_pfrid=" + $.getUrlParam("_frid"));
        }

        //修改的方法
        function edit() {
            var id = getId('#list_data', 'data');//获取选中的行
            var data = $('#list_data').datagrid('getChecked');
            if (id == "") {
                return;
            }
            parent.addTabs("编辑劳动合同签订情况-" + id, contextPath + "system/qdzxapproval/approval/personrenew_detail_add.html?personRenewId=" + p_id + "&id=" + id + "&_pfrid=" + $.getUrlParam("_frid"));
        }

        //删除事件
        function del() {
            var ids = getIds('#list_data', 'data');//获取选中的行ids
            if (ids == "") {
                return;
            }
            $.messager.confirm('提示', '确定要删除吗?', function (r) {
                if (r) {
                    $.ajax({
                        type: 'POST',
                        url: contextPath + 'manager/personRenewDetail/deletes',
                        data: { 'cs': ids },
                        dataType: "json",
                        success: function (data) {
                            $.messager.alert("提示", "删除成功!", 'info', function (rt) {
                                query();
                            });
                        },
                        error: function (response) {
                            $.messager.alert("提示", "出错了，请联系管理员!", 'error', function (rt) {
                                $.messager.alert("提示", response.responseText, 'error');
                            });
                        }
                    });
                }
            });
        }

        //查询
        function query() {
            searchGo(contextPath + "manager/personRenewDetails?i=" + new Date().getTime(), "#search", "#list_data");
        }

        ////加载领导审核意见
        function loadRecord(process_id) {
            $.ajax({
                type: "POST",
                url: contextPath + "manager/approvalRecords/listApprovalRecord/" + process_id,
                data: {},
                dataType: "json",
                success: function (data) {
                    if (data) {
                        var rHtml = "";
                        var msg = "审核"
                        for (var i = 0; i < data.length; i++) {
                            if (data[i].userType == 5) {
                                msg = "复核";
                            } else {
                                msg = "审核"
                            }
                            rHtml += "<div style=\"margin-top:8px;margin-bottom:8px;\">" + msg + "人：" + data[i].approvalUser.truename + "";
                            if (data[i].approvalDate == null) {
                                rHtml += "<span style=\"margin-left:15px;\">尚未" + msg + "</span>";
                            } else {
                                rHtml += "<span style=\"margin-left:15px;\">" + msg + "时间：" + data[i].approvalDate + "</span>";
                                if (data[i].approvalType == 1) {
                                    rHtml += "<span style=\"margin-left:15px;\">" + msg + "选项：同意</span>";
                                } else {
                                    rHtml += "<span style=\"margin-left:15px;\">" + msg + "选项：不同意</span>";
                                }
                                rHtml += "<span style=\"margin-left:15px;\">" + msg + "意见：" + data[i].opinion + "</span>";
                            }
                            rHtml += "</div>";
                        }
                        $("#showRecords").html(rHtml);
                    }
                },
                error: function (response) {
                    $.messager.alert("提示", "出错了，请联系管理员!", 'error', function (rt) {
                        $.messager.alert("提示", response.responseText, 'error');
                    });
                }
            });
        }

        var userType = $.getUrlParam("userType");
        if (userType == 5) {
            //复核可以编辑
            $("#approvalBtn").text("复核");
        }


    </script>
    <div id="loading1"
        style="position: absolute; left: 0px; top: 0px; width: 100%; height: 703px; background: rgb(232, 232, 232); opacity: 0.5; z-index: 10000; display: none;">
    </div>
    <div id="loading2" class="panel-loading"
        style="position: fixed; top: 38%; left: 41%; border: 2px solid rgb(149, 184, 231); width: 160px; font-size: 14px; z-index: 10001; background: url(&quot;/system/jquery/themes/themes1/images/loading-1.gif&quot;) 10px 8px no-repeat rgb(255, 255, 255); display: none;">
        正在处理，请稍等...</div>
</body>